// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using NSQL.Sharpen;

namespace NSQL.Expressions.Functions
{
    public class PowFunction : BaseExpression, IPowFunction
    {
        public INumericExpression X { get; set; }
        public INumericExpression Y { get; set; }
        public PowFunction(INumericExpression x, INumericExpression y)
        {
            X = x;
            Y = y;
        }
        public override T Accept<T>(IExpressionVisitor<T> visitor) => visitor.Visit(this);

        public override void Accept(IExpressionVisitor visitor) => visitor.Visit(this);

        public override bool IsValid => X != null && Y != null&& X.IsValid && Y.IsValid;
        protected override IExpression DeepCopy()
        {
            return new PowFunction(X.DeepClone(), Y.DeepClone())
            {
                Tag = Tag
            };
        }

    }
}